package com.chance.cc.crawler.development.command.trigger.domain.cankao;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class CankaoScheduleTrigger {

    private static final String domainId = "cankao";

    private static CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand("192.168.1.215",9599);

    public static void publishScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "参考网每10分钟定时采集");

//        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
//                crawlerKey,
//                crawlerTriggerKey,
//                domainId,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
//                null,
//                "参考网单次采集");
//        System.out.println("添加采集调度： "+page.getRawText());
    }
}
